// 通用返回类
export class BaseResponse {
  code: number;
  message: string;
  data: any;

  constructor(code: number, message: string, data: any) {
    this.code = code;
    this.message = message;
    this.data = data;
  }

  static success(data: any, message: string = "成功") {
    return new BaseResponse(200, message, data);
  }
  static error(data: any = null, message: string = "错误") {
    return new BaseResponse(400, message, data);
  }
}
